package com.ruoyi.cs.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.cs.domain.TGoodsPricingRange;
import com.ruoyi.cs.mapper.TGoodsPricingRangeMapper;
import com.ruoyi.cs.service.TGoodsPricingRangeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Optional;

/**
 * @ClassName TGoodsPricingRangeServiceImpl
 * @Description TODO
 * @Author zz
 * @Date 2024/2/5
 **/
@Service
@SuppressWarnings("ALL")
public class TGoodsPricingRangeServiceImpl implements TGoodsPricingRangeService {
    @Autowired
    private TGoodsPricingRangeMapper tGoodsPricingRangeMapper;

    @Override
    public TGoodsPricingRange getById(Integer id) {
        return tGoodsPricingRangeMapper.getById(id);
    }

    @Override
    public List<TGoodsPricingRange> getAll() {
        return tGoodsPricingRangeMapper.getAll();
    }

    @Override
    public void addGoodsPricingRange(TGoodsPricingRange range) {
        range.setCreateTime(DateUtils.getNowDate());
        tGoodsPricingRangeMapper.addGoodsPricingRange(range);
    }

    @Override
    public void updateGoodsPricingRange(TGoodsPricingRange range) {
        range.setUpdateTime(DateUtils.getNowDate());
        tGoodsPricingRangeMapper.updateGoodsPricingRange(range);
    }

    @Override
    public void deleteById(Integer id) {
        tGoodsPricingRangeMapper.deleteById(id);
    }
}
